package mytypes

import "time"

type (
	CommonFields struct {
		Id        int64     `db:"id"`
		CreatedAt time.Time `db:"createdAt"`
		UpdatedAt time.Time `db:"updatedAt"`
		Status    int16     `db:"status"`
	}
	PaperQuestionChoice struct {
		CommonFields
		QuestionId int64  `db:"questionId"`
		Order      uint16 `db:"order"`
		Type       int8   `db:"type"`
		Content    string `db:"content"`
	}

	PaperQuestion struct {
		CommonFields
		PaperId int64  `db:"paperId"`
		Order   uint16 `db:"order"`
		Type    int8   `db:"type"`
		Content string `db:"content"`

		//以下为非数据库字段....
		Choices []PaperQuestionChoice `db:"choices"`
	}
)

func (s *PaperQuestion) InitChoices() {
	s.Choices = make([]PaperQuestionChoice, 0)
}
